import { reactive, ref, computed } from 'vue'
import { defineStore } from 'pinia'

export const useCounterStore = defineStore('counter', () => {
  const count = ref(0)
  const doubleCount = computed(() => count.value * 2)
  function increment() {
    count.value++
  }
  const ccstore = reactive({
    "userId": 0,
    "userName": "",
    "password": "",
    "nickName": "",
    "UpdateUserId": '',
    "depId": '',
    "levelRoleId": ""
  })
  const ccTrace = reactive({
    "goodsName": "",          //商品名称
    "traceaBatch": "",          //生产批次
    "traceaQualityDay": '',      //保质期(天)
    "traceaLicenseCode": "",    //生产许可证号
    "traceaEnterpriseName": "", //生产企业
    "traceaPicture": "",        //封面图
  })
  //完成度数  
  const ccWan = reactive({
    WanCount: 14, //总数
    WanInSU_Breed: 0,//养殖信息完成数
    WanInSU_Slaughter: 0,//屠宰信息
    WanInSU_Deep: 0, //深加工信息
    Wancurrent: 0 //当前完成数
  })
  return { count, doubleCount, increment, ccstore, ccTrace, ccWan }
}, { persist: true })
